{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "N7UbxgytUFhn"
      },
      "source": [
        "# Customized models and datasets for CV\n",
        "\n",
        "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/HanXudong/fairlib/blob/main/tutorial/Image_Inputs.ipynb)\n",
        "\n",
        "In this tutorial we will:\n",
        "- Show how to add a model for image classification\n",
        "- Show how to add a dataloader with image preprocessing\n",
        "\n",
        "We will be using the colored MNIST dataset, please see the [origianl](https://colab.research.google.com/github/reiinakano/invariant-risk-minimization/blob/master/invariant_risk_minimization_colored_mnist.ipynb#scrollTo=knP-xNzavgAb&uniqifier=1) demo for more details."
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Installation\n",
        "\n",
        "Again, the first step will be installing our libarary"
      ],
      "metadata": {
        "id": "0387Gb3quLfv"
      }
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "u4z-4H6bU9Is",
        "outputId": "9a4cdca8-a176-4e2d-ee26-04606872d656"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "\u001b[K     |████████████████████████████████| 85 kB 1.2 MB/s \n",
            "\u001b[K     |████████████████████████████████| 256 kB 34.4 MB/s \n",
            "\u001b[K     |████████████████████████████████| 880 kB 60.2 MB/s \n",
            "\u001b[K     |████████████████████████████████| 4.4 MB 57.8 MB/s \n",
            "\u001b[K     |████████████████████████████████| 101 kB 12.4 MB/s \n",
            "\u001b[K     |████████████████████████████████| 596 kB 36.3 MB/s \n",
            "\u001b[K     |████████████████████████████████| 6.6 MB 12.4 MB/s \n",
            "\u001b[?25h  Building wheel for sacremoses (setup.py) ... \u001b[?25l\u001b[?25hdone\n"
          ]
        }
      ],
      "source": [
        "!pip install -q fairlib"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 2,
      "metadata": {
        "id": "Xt6TeF2FVD0i"
      },
      "outputs": [],
      "source": [
        "import fairlib"
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Explore Datasets"
      ],
      "metadata": {
        "id": "FYYmW60ZuO25"
      }
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "metadata": {
        "id": "8RvXBTGJUDTt"
      },
      "outputs": [],
      "source": [
        "import os\n",
        "\n",
        "import numpy as np\n",
        "from PIL import Image\n",
        "\n",
        "import matplotlib.pyplot as plt\n",
        "\n",
        "import torch\n",
        "import torch.nn as nn\n",
        "import torch.nn.functional as F\n",
        "import torch.optim as optim\n",
        "from torch.autograd import grad\n",
        "from torchvision import transforms\n",
        "from torchvision import datasets\n",
        "import torchvision.datasets.utils as dataset_utils"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 4,
      "metadata": {
        "id": "YlHbWs8QUDTv"
      },
      "outputs": [],
      "source": [
        "def color_grayscale_arr(arr, red=True):\n",
        "    \"\"\"Converts grayscale image to either red or green\"\"\"\n",
        "    assert arr.ndim == 2\n",
        "    dtype = arr.dtype\n",
        "    h, w = arr.shape\n",
        "    arr = np.reshape(arr, [h, w, 1])\n",
        "    if red:\n",
        "        arr = np.concatenate([\n",
        "            arr,\n",
        "            np.zeros((h, w, 2), dtype=dtype)], axis=2)\n",
        "    else:\n",
        "        arr = np.concatenate([\n",
        "            np.zeros((h, w, 1), dtype=dtype),\n",
        "            arr,\n",
        "            np.zeros((h, w, 1), dtype=dtype)], axis=2)\n",
        "    return arr"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 5,
      "metadata": {
        "id": "BoPDWwu3UDTw"
      },
      "outputs": [],
      "source": [
        "root = \"./data\""
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 6,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 423,
          "referenced_widgets": [
            "f476f1ef666d451d845aae44e2cd0735",
            "350013664d2547dab32f22c3daf5ea86",
            "c39600fb97154bba9520460cb2790f73",
            "638a20255163424099d89e0bdf1ea4f6",
            "d4a1ff4e49b64c10a3fddbac8d1fb8da",
            "b8191bed08814b7182700dc3265b9630",
            "80c25effb753416ea40429f6aa9d495f",
            "8cd753be9f5141d7bff11788eba930a7",
            "b393370e359344c59b7bd333c30749ad",
            "0da7f60955a644e9b84b89065fc5bd7e",
            "6e7232d9fec541a4b21d13208a9f3dbf",
            "cf77d1cf4ab5417eb45ebb8cbbf0b238",
            "a9f10e46cf5e44eb8c446dc92912dea9",
            "81631b8da4bd4e50bdf0e297b56df82e",
            "25ac5d7180ef4549b99d4078529ee67c",
            "a0c0d164adc54af0bb2ce4d54787e7f6",
            "69baf1d249704c5cabd181f7333cf7f9",
            "ce5d67d6be5243ccbd3a1382fbcf30ec",
            "24f96010cab4484faa46aa70ed3d23bb",
            "e92ac01372cb4a4b8dbb7a7db7991073",
            "b4ad8d187b094ffd8aefcef1680d4ffb",
            "7b6298fe6b2f4307906ae5021caa4d4b",
            "7cb8b35ea5f8401fa9e5c52546d2324e",
            "a426c8a9ad3b46589d9fce4f3b60a73b",
            "94ad67e14d53417a91983e1c197993a5",
            "83490315ba8c49c8a860f4ea6acd7956",
            "dec18cf4bb694ac987fa8689c64d2ac6",
            "42e5290426df4608a7216a392760310c",
            "0b58cdde644e4bff889adb2332c644ce",
            "d7fc7b1718e4456cabb199a03e5d79d9",
            "3ba0ea02505846dda98c9dd19bcab8c5",
            "973ebcf9fc4043b48baf2daff6b47cbe",
            "560480b544b049919e62816d119fb66b",
            "3c012ef53bc74d048a15291265af0ce0",
            "18cdf54a8b5642fba326d0ce4e35dfb7",
            "7af12cf5083745c695caaa94fc9eada6",
            "6a1cd3efa5b64bbeb43b2fdec01ee400",
            "e95bdfb506ba42249adae72fee60ea72",
            "71d4d1d4e32542d8beffc7bb8d5354fd",
            "ce5c98c15b9e4b0f92e622589da4189d",
            "946690ebb4994fb496af345ddb02c8f3",
            "941032cafeb849108a0615dd825a05fd",
            "99b2c841b8b34e669e50d7d715fb55d5",
            "3a5754597a944854a69718b6a21c4a6a"
          ]
        },
        "id": "5xRQv3M4UDTw",
        "outputId": "4c2e1cf7-afc2-4107-b27f-fdc7ab6eec44"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz\n",
            "Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to ./data/MNIST/raw/train-images-idx3-ubyte.gz\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "  0%|          | 0/9912422 [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "f476f1ef666d451d845aae44e2cd0735"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Extracting ./data/MNIST/raw/train-images-idx3-ubyte.gz to ./data/MNIST/raw\n",
            "\n",
            "Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz\n",
            "Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz to ./data/MNIST/raw/train-labels-idx1-ubyte.gz\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "  0%|          | 0/28881 [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "cf77d1cf4ab5417eb45ebb8cbbf0b238"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Extracting ./data/MNIST/raw/train-labels-idx1-ubyte.gz to ./data/MNIST/raw\n",
            "\n",
            "Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz\n",
            "Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz to ./data/MNIST/raw/t10k-images-idx3-ubyte.gz\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "  0%|          | 0/1648877 [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "7cb8b35ea5f8401fa9e5c52546d2324e"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Extracting ./data/MNIST/raw/t10k-images-idx3-ubyte.gz to ./data/MNIST/raw\n",
            "\n",
            "Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz\n",
            "Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz to ./data/MNIST/raw/t10k-labels-idx1-ubyte.gz\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "  0%|          | 0/4542 [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "3c012ef53bc74d048a15291265af0ce0"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Extracting ./data/MNIST/raw/t10k-labels-idx1-ubyte.gz to ./data/MNIST/raw\n",
            "\n"
          ]
        }
      ],
      "source": [
        "train_mnist = datasets.mnist.MNIST(root=root, train=True, download=True)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 7,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 166
        },
        "id": "sSU49yJVUDTy",
        "outputId": "da01dab6-5a8f-4bd2-dfe5-9c595f2fb999"
      },
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "<matplotlib.image.AxesImage at 0x7fbdcef158d0>"
            ]
          },
          "metadata": {},
          "execution_count": 7
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "<Figure size 432x288 with 3 Axes>"
            ],
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAACECAYAAACJbXCEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAANr0lEQVR4nO3de4xU1R0H8O/PZYEiIKzoFhEBcQVBVOpWUInaVJQaG2usVTSGKA1pBZWWGpE2qTZqsFUTRGrEiGjj+9GwbdpSu0VqI27FZ3l0AXlEcFnELWDxAez++seOd8457MzO3LlzZ86d7ych+zvz25l73N/427tn7kNUFURE5J8jSj0BIiIKhw2ciMhTbOBERJ5iAyci8hQbOBGRp9jAiYg8VVADF5EpItIsIptEZG5Uk6LSYl2Ti7VNFgl7HLiIVAHYAGAygO0A3gQwVVXXRTc9ihvrmlysbfL0KOC5ZwHYpKqbAUBEngVwGYCMb4ae0kt748gCNklR+AL7cUC/lAzpvOsqIjwbrEyoaqa6AnnWlnUtK7tV9Rj3wUIa+BAAHxrj7QAmZHtCbxyJCfLtAjZJUWjSxmzpvOtK3mBt/bWtqwcLaeA5EZEZAGYAQG/0KfbmKCZmXSk5WFe/FPIh5g4AQ43x8anHLKq6WFXrVbW+Gr0K2BzFJO+6xjYzKlS3tWVd/VJIA38TQJ2IjBCRngCuBtAQzbSohFjX5GJtEyb0EoqqHhKRWQCWA6gCsERV10Y2MyoJ1jW5WNvkCX0YYRj9pUb5IWbpNWkj9mlbtqMV8sKjFcpHN0eh5IV1LStvdbWsxTMxiYg8xQZOROQpNnAiIk+xgRMReYoNnIjIU2zgRESeYgMnIvIUGzgRkafYwImIPMUGTkTkKTZwIiJPFf164D6SHvaPpeqYQTk/t/lnw4O4vU+HlRs2clcQ97nRvmTFzgd6BvHb9c9Zud3t+4N4wgtzrNxJP30j57lVuipnfFQez51lxO5V7UcZ8Uwnd58RT3VyXxjxfCd3Z+5TowouLPfAiYg8xQZOROSpRC+hVJ1SZ421V3UQf3T+ACv3+cT0MkXNUfut3Gun20saYf35s35BfO9DU6xc07ing3jLwc+t3PzWyUF83Gu8wucJzrinEZ/j5CYZ8QAnd0VE89luxA86ucuN+FMn954Rr4xoLl5jYfPGPXAiIk+xgRMReYoNnIjIU4m7pVr7Bd8I4gVLF1m5k6t7ut9eVAe13Rqf8+vZQdxjf+afe78dh6xxr93pNXFdvabgefl4S7XxRtzo5PI5aiwKHc74BiPej8w+csb/NeLmgmaU5t0t1VjYXPGWakREScIGTkTkqcQdRtirOf33zFtfDLVyJ1e3Fvz6c1omWuPN/7PP0lw68sUg3tth/wVa++DrobbJAweBbUb8iZOL4i/tJme8xxl/y4gPOLnfRbD9isXCFoR74EREnmIDJyLyFBs4EZGnErcGfqhlZxAvvPdKK3f3lPSxQFXv97Vy7924MONr3rX7tCDedKF9ybL2PS3W+JqzbwzirTfbrzPCOseW8tFmxLc6uUuN+B0n554BbXrXiCc7OfeosbFGfEuW16Q8sbAF6XYPXESWiMguEVljPFYjIq+IyMbU14HFnSZFjXVNLta2cuSyhLIUwBTnsbkAGlW1Dp2H38+NeF5UfEvBuibVUrC2FSGnMzFFZDiAP6rqqalxM4ALVLVFRAYDeFVVR2V5CQDxnImZTdWgo4O4/ZM2K7fl6fQyydrzlli5s+65KYiPXRTuUMBy8tWZmFHVNZYz9rLob8TuheEeMeLpTu46I34ayfDVmZhR1LbUdWVhLZGeiVmrql8t/u4EUBt6WlROWNfkYm0TqOAPMVVVs/2mFpEZAGYAQO/D7llE5SqfupJfstWWdfVL2D3w1tSfYUh93ZXpG1V1sarWq2p9NXqF3BzFJFRdY5sdFSKn2rKufgm7B94AYBo6b9k5DcCyyGZURO273XN10w7uy3ylwrHXrgvijx927qDa0Y4E8bKu+7Lk9mbJ/dCIn3Vy7oXpEsC/2rKw3crlMMJnAKwCMEpEtovIdHS+CSaLyEYAF+Lwey9TmWNdk4u1rRzd7oGr6tQMqdIdTkIFY12Ti7WtHIk7EzOsU27bEMTXj7Pf548PS19p/vwrZ1q5fs+9UdyJUUHuMOIzndz5Rnyhk/trUWZDkbnDiCu4sLwWChGRp9jAiYg8xQZOROSpxN3UOApHnH6KNX6o4dEgXnvgWCt3+/uXW2N9J30bkaF3r7JfOMafdTY+3tQ4CiOd8dtG7N6oZYUzXm3Ei5xcOf3He3dT4yhUQmF5U2MiomRhAyci8hSXUHLQdsPZQfzUL++zciN69M74vLFPzrLGdY+mb/5waPPWaCYXQqUuobjMxa/HnVy/LM+b54yfNOIWlFZFLqG4klhYLqEQESULGzgRkafYwImIPMU18DzpuWdY4/7zt1vjZ05cnvG5o1ekL5M26k77cmrtGzdHMLvccA38cOOc8f3OONu71rw5zN1ObkfoGYXDNXBHUgrLNXAiomRhAyci8hQbOBGRp7gGXqCqWvvU+o+uOimIm25bYOWOMH5fXrvlIiu3d1LmuwVFjWvg3RvgjL9rxO6hxeYP8u9ObnJkM8oN18C74WthuQZORJQsbOBERJ7iEkoRPb/dvhphH0nfOPkzPWDlLr1pdvr7ft9U1HlxCaUwXzpj87ZWh5zcxUb8alFmY+MSSgHKubBcQiEiShY2cCIiT7GBExF5inelz1PHJPtU+g+utC8ne+oZW4PYXPN2LWwbb437LFud4TspDqc54+87428acbb/adY543+EnhFFIuGF5R44EZGn2MCJiDzFJZQuSP2p1njDzemlkEfPfcLKndfbPhwwmy/1YBC/0TbCTnaU/pYfSTfKGd9kxJc7ua/n8brtRuxWsSOP16GQKriw3AMnIvJUtw1cRIaKyAoRWScia0XkltTjNSLyiohsTH0dWPzpUlRY12RiXStLLnvghwDMUdUxACYCmCkiYwDMBdCoqnUAGlNj8gfrmkysawXpdg1cVVuQWgFS1U9FZD2AIQAuA3BB6tueQOcJpbcVZZZF0GPEMGv8wfXHBfEdVz1r5a7ouzvUNua12me+rlwwMYgHPrHK/fZYJbWu7hLnNUY808kND7kN94BP82YtDSFfMypJrWvFFzaDvD7EFJHhAMYDaAJQm3qzAMBOALUZnjMDwAwA6I0+YedJRVRoXak8sa7Jl/OHmCLSF8BLAGar6j4zp51XxOrywjequlhV61W1vhq9CposRS+KusYwTcoT61oZctoDF5FqdL4ZnlLVl1MPt4rIYFVtEZHBAHYVa5Jh9Rh+gjXee+bgIL7qV3+xcj8a8DLCmNMy0Rqv+m36fV+z9F9WbmBHaZdNXL7W1d11HGvEC53c6JDbcK8H+RsjXubkyuSIsoCvdWVh85fLUSgC4DEA61X1ASPVAGBaKp6Gw//zqYyxrsnEulaWXPbAzwVwHYB/i8i7qcfmAZgP4HkRmQ5gG4AfFGeKVCSsazKxrhUkl6NQ/gn77nCmyrk7Q8KwrsnEulYW70+l7zHYPr6obcmRQfzjESut3NR+raG2MWvHpCB++2H7aoSDXlxjjWs+La91bl/VOONHjPgMJ3diyG28bsT3O7nlzvjzkNsgBwsbKZ5KT0TkKTZwIiJPebGEcuBi+5DUAz9pC+J5J/3Jyl30tf2httHanv5b6ryGOVZu9C/+E8Q1e+wlEg+ONCpbE5zxrUZ8lpMbEnIb5l/IC5zcPUYc7l1DXWJhY8M9cCIiT7GBExF5ig2ciMhTXqyBb/2e/Xtmw7gXcnreoj0jrfGClRcFsbTbh8qOvmtLENe12ufbtoOKwb1ZijvOZL0z/oMRu7W6z4j35Pj6VCAWNjbcAyci8hQbOBGRp6TzypLx6C81OkF4Nm+pNWkj9mlbptOt8yYi8b2JKCtVZV2T6a2uLvHLPXAiIk+xgRMReYoNnIjIU2zgRESeYgMnIvIUGzgRkafYwImIPMUGTkTkKTZwIiJPsYETEXkq1lPpReRjANsADAKwO7YNZ1eJcxmmqsdE9WKsa7dY1+hU6ly6rG2sDTzYqMjqrs7rLwXOJTrlNH/OJTrlNH/OxcYlFCIiT7GBExF5qlQNfHGJttsVziU65TR/ziU65TR/zsVQkjVwIiIqHJdQiIg8FWsDF5EpItIsIptEZG6c205tf4mI7BKRNcZjNSLyiohsTH0dGMM8horIChFZJyJrReSWUs0lCqyrNZfE1JZ1teZSlnWNrYGLSBWARQC+A2AMgKkiMiau7acsBTDFeWwugEZVrQPQmBoX2yEAc1R1DICJAGamfhalmEtBWNfDJKK2rOthyrOuqhrLPwBnA1hujG8HcHtc2ze2OxzAGmPcDGBwKh4MoLkEc1oGYHI5zIV1ZW1ZV3/qGucSyhAAHxrj7anHSq1WVVtS8U4AtXFuXESGAxgPoKnUcwmJdc3A89qyrhmUU135IaZBO3+NxnZYjoj0BfASgNmquq+Uc0myUvwsWdviY13jbeA7AAw1xsenHiu1VhEZDACpr7vi2KiIVKPzjfCUqr5cyrkUiHV1JKS2rKujHOsaZwN/E0CdiIwQkZ4ArgbQEOP2M2kAMC0VT0Pn2lZRiYgAeAzAelV9oJRziQDrakhQbVlXQ9nWNeaF/0sAbADwAYCfl+CDh2cAtAA4iM41vekAjkbnp8cbAfwNQE0M85iEzj+13gfwburfJaWYC+vK2rKu/taVZ2ISEXmKH2ISEXmKDZyIyFNs4EREnmIDJyLyFBs4EZGn2MCJiDzFBk5E5Ck2cCIiT/0fhwMeOv6lQOcAAAAASUVORK5CYII=\n"
          },
          "metadata": {
            "needs_background": "light"
          }
        }
      ],
      "source": [
        "fig, ax = plt.subplots(1,3)\n",
        "ax[0].imshow(train_mnist[0][0]) # Original\n",
        "ax[1].imshow(color_grayscale_arr(np.array(train_mnist[0][0]))) # Red\n",
        "ax[2].imshow(color_grayscale_arr(np.array(train_mnist[0][0]), False)) # Green"
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "from fairlib import datasets"
      ],
      "metadata": {
        "id": "sPg6TyThXugW"
      },
      "execution_count": 8,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "datasets.prepare_dataset(\"coloredmnist\", \"coloredmnist\")"
      ],
      "metadata": {
        "id": "WX5rUiCSX7p3",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 666,
          "referenced_widgets": [
            "98dffc6c6e784decb165b104dda25eea",
            "b2f715e769dd41d887d8b68b25eba686",
            "b0133d2f7ae945bdba6bd2f285da251a",
            "d11573a5f6054a14b7d24f256c6c5664",
            "26849eb841d44d9285b58698217bd7a6",
            "9dee0fbb50f645cf865e58fdadb52160",
            "f4f2d9993a0d456fb75b4c2148a45e8f",
            "cae8fe4d51d64e0a8638d008a16f12cf",
            "2f2bb2e08d194286bb25185161cc16a0",
            "0d1adfd350fb47e7bc42d195febb7403",
            "0a56f053c7ed4a2fbc010141280ee559",
            "e14c40fc216f4d23925a23875189d5c6",
            "17b37119ce2b4dc882e684b7e73b1b30",
            "d5958c8ebd854a2fab9b3de2df64fc4a",
            "a3900a446db446c6af54bab34c9c146a",
            "2a180bb795eb4667b0fcb2d61c2a7b0f",
            "fb8a816f36004a3fae9fa29ea7746744",
            "22ffe204bb144301a8a6d76f7498c4d9",
            "4977d2c141f74ce5a49d23d6d33d4f52",
            "9158bd9daf4c4790b1a8ec8408e0315d",
            "244472db2ef04366a1310e3319c178b6",
            "7c1128aa2d8c4bdeae004552c49f74fb",
            "ee47162c16d9412e96dcf712deef60d0",
            "abedf6d04500432e8de53ee13e5bbc04",
            "a5a522a3871e4ce8830ab491a56abb82",
            "e1c70c718b4544f3bdef10c25adf3269",
            "7f0725431328403ab983b669fb2bb8bb",
            "b81473d83001464eabd4488d0e531c46",
            "84844064e27b4a97bc1b51a568dc8b19",
            "cb2d7c0e25e2448a9e798b7e18e18c5b",
            "a3bbb9658a474726bfb39957c60b8492",
            "a4456d82cca6453a8923fb0a9ba50655",
            "01b651eb04b14703a857dca81c267a76",
            "b01c8ad2f24c40f49bcfd29b55e62037",
            "ba938b75f05345f5ab996e6a91a3f154",
            "1bd04f11f0484ae2b80aa5486e21422d",
            "d608838383cc4771918f4e0f26636001",
            "99f31a083199483fa767c28b5f8303ae",
            "f98eeccb241e479a97f56345686a1c2d",
            "accd6192f90f4a52ab5e90b4b98e1d7d",
            "80a488d4c84a4a99b804f6a868919418",
            "e3c9eff582a4489594792f0757b84a5b",
            "0ee298418327491ba7d8f5fe5a73edb6",
            "62f4378e324c44b79a8e4a9107537e25"
          ]
        },
        "outputId": "8913ff14-480f-46ce-bae4-204551b00749"
      },
      "execution_count": 9,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz\n",
            "Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to coloredmnist/MNIST/raw/train-images-idx3-ubyte.gz\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "  0%|          | 0/9912422 [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "98dffc6c6e784decb165b104dda25eea"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Extracting coloredmnist/MNIST/raw/train-images-idx3-ubyte.gz to coloredmnist/MNIST/raw\n",
            "\n",
            "Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz\n",
            "Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz to coloredmnist/MNIST/raw/train-labels-idx1-ubyte.gz\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "  0%|          | 0/28881 [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "e14c40fc216f4d23925a23875189d5c6"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Extracting coloredmnist/MNIST/raw/train-labels-idx1-ubyte.gz to coloredmnist/MNIST/raw\n",
            "\n",
            "Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz\n",
            "Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz to coloredmnist/MNIST/raw/t10k-images-idx3-ubyte.gz\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "  0%|          | 0/1648877 [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "ee47162c16d9412e96dcf712deef60d0"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Extracting coloredmnist/MNIST/raw/t10k-images-idx3-ubyte.gz to coloredmnist/MNIST/raw\n",
            "\n",
            "Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz\n",
            "Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz to coloredmnist/MNIST/raw/t10k-labels-idx1-ubyte.gz\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "  0%|          | 0/4542 [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "b01c8ad2f24c40f49bcfd29b55e62037"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Extracting coloredmnist/MNIST/raw/t10k-labels-idx1-ubyte.gz to coloredmnist/MNIST/raw\n",
            "\n",
            "Converting image 0/50000\n",
            "Converting image 5000/50000\n",
            "Converting image 10000/50000\n",
            "Converting image 15000/50000\n",
            "Converting image 20000/50000\n",
            "Converting image 25000/50000\n",
            "Converting image 30000/50000\n",
            "Converting image 35000/50000\n",
            "Converting image 40000/50000\n",
            "Converting image 45000/50000\n",
            "Converting image 0/10000\n",
            "Converting image 5000/10000\n",
            "Converting image 0/10000\n",
            "Converting image 5000/10000\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 10,
      "metadata": {
        "id": "3qOYUt8eUDT2"
      },
      "outputs": [],
      "source": [
        "from fairlib import networks, BaseOptions, dataloaders"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 11,
      "metadata": {
        "id": "WIQgZgVgUDT2"
      },
      "outputs": [],
      "source": [
        "Shared_options = {\n",
        "    # The name of the dataset, correponding dataloader will be used,\n",
        "    \"dataset\":  \"MNIST\",\n",
        "\n",
        "    # Specifiy the path to the input data\n",
        "    \"data_dir\": \"./coloredmnist\",\n",
        "\n",
        "    # Device for computing, -1 is the cpu\n",
        "    \"device_id\": -1,\n",
        "\n",
        "    # The default path for saving experimental results\n",
        "    \"results_dir\":  r\"results\",\n",
        "\n",
        "    # The same as the dataset\n",
        "    \"project_dir\":  r\"dev\",\n",
        "\n",
        "    # We will focusing on TPR GAP, implying the Equalized Odds for binay classification.\n",
        "    \"GAP_metric_name\":  \"TPR_GAP\",\n",
        "\n",
        "    # The overall performance will be measured as accuracy\n",
        "    \"Performance_metric_name\":  \"accuracy\",\n",
        "\n",
        "    # Model selections are based on DTO\n",
        "    \"selection_criterion\":  \"DTO\",\n",
        "\n",
        "    # Default dirs for saving checkpoints\n",
        "    \"checkpoint_dir\":   \"models\",\n",
        "    \"checkpoint_name\":  \"checkpoint_epoch\",\n",
        "\n",
        "\n",
        "    \"n_jobs\":   1,\n",
        "}"
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Customizing NN Architectures"
      ],
      "metadata": {
        "id": "L9Y4kuaFuS6d"
      }
    },
    {
      "cell_type": "code",
      "execution_count": 12,
      "metadata": {
        "id": "k-ts_cMOUDT2"
      },
      "outputs": [],
      "source": [
        "class ConvNet(networks.utils.BaseModel):\n",
        "\n",
        "    def __init__(self, args):\n",
        "        super(ConvNet, self).__init__()\n",
        "        self.args = args\n",
        "        \n",
        "        self.conv1 = nn.Conv2d(3, 20, 5, 1)\n",
        "        self.conv2 = nn.Conv2d(20, 50, 5, 1)\n",
        "\n",
        "        self.classifier = networks.classifier.MLP(args)\n",
        "\n",
        "        self.init_for_training()\n",
        "\n",
        "    def forward(self, input_data, group_label = None):\n",
        "        x = input_data\n",
        "        x = F.relu(self.conv1(x))\n",
        "        x = F.max_pool2d(x, 2, 2)\n",
        "        x = F.relu(self.conv2(x))\n",
        "        x = F.max_pool2d(x, 2, 2)\n",
        "        x = x.view(-1, 4 * 4 * 50)\n",
        "\n",
        "        return self.classifier(x, group_label)\n",
        "    \n",
        "    def hidden(self, input_data, group_label = None):\n",
        "        x = input_data\n",
        "        x = F.relu(self.conv1(x))\n",
        "        x = F.max_pool2d(x, 2, 2)\n",
        "        x = F.relu(self.conv2(x))\n",
        "        x = F.max_pool2d(x, 2, 2)\n",
        "        x = x.view(-1, 4 * 4 * 50)\n",
        "\n",
        "        return self.classifier.hidden(x, group_label)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 13,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "-fAarStJUDT2",
        "outputId": "e71f4ab4-5941-4b95-a5ab-e58ae6247404"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "INFO:root:Unexpected args: ['-f', '/root/.local/share/jupyter/runtime/kernel-a7e24054-f7e0-4930-9df2-bfcd40fedbad.json']\n",
            "INFO:root:Logging to ./results/dev/MNIST/vanilla/output.log\n"
          ]
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "2022-07-21 07:19:08 [INFO ]  ======================================== 2022-07-21 07:19:08 ========================================\n",
            "2022-07-21 07:19:08 [INFO ]  Base directory is ./results/dev/MNIST/vanilla\n",
            "2022-07-21 07:19:09 [INFO ]  Exception type : AssertionError \n",
            "2022-07-21 07:19:09 [INFO ]  Exception message : Not implemented\n",
            "2022-07-21 07:19:09 [INFO ]  Stack trace : ['File : /usr/local/lib/python3.7/dist-packages/fairlib/src/base_options.py , Line : 486, Func.Name : set_state, Message : train_iterator, dev_iterator, test_iterator = dataloaders.get_dataloaders(state)', 'File : /usr/local/lib/python3.7/dist-packages/fairlib/src/dataloaders/__init__.py , Line : 40, Func.Name : get_dataloaders, Message : ], \"Not implemented\"']\n",
            "2022-07-21 07:19:09 [INFO ]  dataloaders need to be initialized!\n"
          ]
        }
      ],
      "source": [
        "args = {\n",
        "    \"dataset\":Shared_options[\"dataset\"], \n",
        "    \"data_dir\":Shared_options[\"data_dir\"],\n",
        "    \"device_id\":Shared_options[\"device_id\"],\n",
        "\n",
        "    # Give a name to the exp, which will be used in the path\n",
        "    \"exp_id\":\"vanilla\",\n",
        "\n",
        "    \"emb_size\": 4*4*50,\n",
        "    \"num_classes\": 10,\n",
        "    \"num_groups\": 2,\n",
        "}\n",
        "\n",
        "# Init the argument\n",
        "options = BaseOptions()\n",
        "state = options.get_state(args=args, silence=True)"
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Customizing Dataloader"
      ],
      "metadata": {
        "id": "79d9l4zauZCy"
      }
    },
    {
      "cell_type": "code",
      "execution_count": 14,
      "metadata": {
        "id": "1L9WAC7jUDT3"
      },
      "outputs": [],
      "source": [
        "class CustomizedDataset(dataloaders.utils.BaseDataset):\n",
        "\n",
        "    transform=transforms.Compose([\n",
        "        transforms.ToTensor(),\n",
        "        transforms.Normalize((0.1307, 0.1307, 0.), (0.3081, 0.3081, 0.3081))])\n",
        "\n",
        "    def load_data(self):\n",
        "\n",
        "        self.data_dir = os.path.join(self.args.data_dir, \"colored_MNIST_{}.pt\".format(self.split))\n",
        "\n",
        "        data = torch.load(self.data_dir)\n",
        "\n",
        "        self.X = [self.transform(_img) for _img in data[0]]\n",
        "        self.y = data[1]\n",
        "        self.protected_label = data[2]"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 15,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "xXc659mpUDT3",
        "outputId": "e0ae2364-54b3-422f-84c2-57e5f0a62deb"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Loaded data shapes: (50000,), (50000,), (50000,)\n",
            "Loaded data shapes: (10000,), (10000,), (10000,)\n",
            "Loaded data shapes: (10000,), (10000,), (10000,)\n"
          ]
        }
      ],
      "source": [
        "customized_train_data = CustomizedDataset(args=state, split=\"train\")\n",
        "customized_dev_data = CustomizedDataset(args=state, split=\"dev\")\n",
        "customized_test_data = CustomizedDataset(args=state, split=\"test\")\n",
        "\n",
        "# DataLoader Parameters\n",
        "tran_dataloader_params = {\n",
        "        'batch_size': state.batch_size,\n",
        "        'shuffle': True,\n",
        "        'num_workers': state.num_workers}\n",
        "\n",
        "eval_dataloader_params = {\n",
        "        'batch_size': state.test_batch_size,\n",
        "        'shuffle': False,\n",
        "        'num_workers': state.num_workers}\n",
        "\n",
        "# init dataloader\n",
        "customized_training_generator = torch.utils.data.DataLoader(customized_train_data, **tran_dataloader_params)\n",
        "customized_validation_generator = torch.utils.data.DataLoader(customized_dev_data, **eval_dataloader_params)\n",
        "customized_test_generator = torch.utils.data.DataLoader(customized_test_data, **eval_dataloader_params)"
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Training vanilla model without debiasing"
      ],
      "metadata": {
        "id": "5DccTHInud3d"
      }
    },
    {
      "cell_type": "code",
      "execution_count": 16,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "SGfihIUqUDT3",
        "outputId": "f2723877-bbad-4146-e3ec-e963b824421b"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "2022-07-21 07:19:20 [INFO ]  MLP( \n",
            "2022-07-21 07:19:20 [INFO ]    (output_layer): Linear(in_features=300, out_features=10, bias=True)\n",
            "2022-07-21 07:19:20 [INFO ]    (AF): Tanh()\n",
            "2022-07-21 07:19:20 [INFO ]    (hidden_layers): ModuleList(\n",
            "2022-07-21 07:19:20 [INFO ]      (0): Linear(in_features=800, out_features=300, bias=True)\n",
            "2022-07-21 07:19:20 [INFO ]      (1): Tanh()\n",
            "2022-07-21 07:19:20 [INFO ]      (2): Linear(in_features=300, out_features=300, bias=True)\n",
            "2022-07-21 07:19:20 [INFO ]      (3): Tanh()\n",
            "2022-07-21 07:19:20 [INFO ]    )\n",
            "2022-07-21 07:19:20 [INFO ]    (criterion): CrossEntropyLoss()\n",
            "2022-07-21 07:19:20 [INFO ]  )\n",
            "2022-07-21 07:19:20 [INFO ]  Total number of parameters: 333610 \n",
            "\n",
            "2022-07-21 07:19:20 [INFO ]  ConvNet( \n",
            "2022-07-21 07:19:20 [INFO ]    (conv1): Conv2d(3, 20, kernel_size=(5, 5), stride=(1, 1))\n",
            "2022-07-21 07:19:20 [INFO ]    (conv2): Conv2d(20, 50, kernel_size=(5, 5), stride=(1, 1))\n",
            "2022-07-21 07:19:20 [INFO ]    (classifier): MLP(\n",
            "2022-07-21 07:19:20 [INFO ]      (output_layer): Linear(in_features=300, out_features=10, bias=True)\n",
            "2022-07-21 07:19:20 [INFO ]      (AF): Tanh()\n",
            "2022-07-21 07:19:20 [INFO ]      (hidden_layers): ModuleList(\n",
            "2022-07-21 07:19:20 [INFO ]        (0): Linear(in_features=800, out_features=300, bias=True)\n",
            "2022-07-21 07:19:20 [INFO ]        (1): Tanh()\n",
            "2022-07-21 07:19:20 [INFO ]        (2): Linear(in_features=300, out_features=300, bias=True)\n",
            "2022-07-21 07:19:20 [INFO ]        (3): Tanh()\n",
            "2022-07-21 07:19:20 [INFO ]      )\n",
            "2022-07-21 07:19:20 [INFO ]      (criterion): CrossEntropyLoss()\n",
            "2022-07-21 07:19:20 [INFO ]    )\n",
            "2022-07-21 07:19:20 [INFO ]    (criterion): CrossEntropyLoss()\n",
            "2022-07-21 07:19:20 [INFO ]  )\n",
            "2022-07-21 07:19:20 [INFO ]  Total number of parameters: 360180 \n",
            "\n"
          ]
        }
      ],
      "source": [
        "model = ConvNet(state)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 17,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "BzHN7paxUDT4",
        "outputId": "6582db86-76c5-498d-f724-47c5f871b889"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "2022-07-21 07:19:20 [INFO ]  Epoch:    0 [      0/  50000 ( 0%)]\tLoss: 2.3093\t Data Time: 0.01s\tTrain Time: 0.77s\n",
            "2022-07-21 07:19:51 [INFO ]  Evaluation at Epoch 0\n",
            "2022-07-21 07:19:53 [INFO ]  Validation accuracy: 95.53\tmacro_fscore: 95.52\tmicro_fscore: 95.53\tTPR_GAP: 4.69\tFPR_GAP: 0.40\tPPR_GAP: 0.74\t\n",
            "2022-07-21 07:19:53 [INFO ]  Test accuracy: 96.45\tmacro_fscore: 96.42\tmicro_fscore: 96.45\tTPR_GAP: 3.58\tFPR_GAP: 0.37\tPPR_GAP: 0.72\t\n",
            "2022-07-21 07:19:54 [INFO ]  Epoch:    1 [      0/  50000 ( 0%)]\tLoss: 0.1037\t Data Time: 0.01s\tTrain Time: 0.59s\n",
            "2022-07-21 07:20:25 [INFO ]  Evaluation at Epoch 1\n",
            "2022-07-21 07:20:28 [INFO ]  Validation accuracy: 97.29\tmacro_fscore: 97.29\tmicro_fscore: 97.29\tTPR_GAP: 2.54\tFPR_GAP: 0.27\tPPR_GAP: 0.67\t\n",
            "2022-07-21 07:20:28 [INFO ]  Test accuracy: 97.42\tmacro_fscore: 97.40\tmicro_fscore: 97.42\tTPR_GAP: 3.33\tFPR_GAP: 0.35\tPPR_GAP: 0.73\t\n",
            "2022-07-21 07:20:28 [INFO ]  Epoch:    2 [      0/  50000 ( 0%)]\tLoss: 0.0530\t Data Time: 0.01s\tTrain Time: 0.58s\n",
            "2022-07-21 07:21:01 [INFO ]  Evaluation at Epoch 2\n",
            "2022-07-21 07:21:04 [INFO ]  Validation accuracy: 97.48\tmacro_fscore: 97.48\tmicro_fscore: 97.48\tTPR_GAP: 3.68\tFPR_GAP: 0.39\tPPR_GAP: 0.71\t\n",
            "2022-07-21 07:21:04 [INFO ]  Test accuracy: 97.97\tmacro_fscore: 97.96\tmicro_fscore: 97.97\tTPR_GAP: 3.30\tFPR_GAP: 0.31\tPPR_GAP: 0.98\t\n",
            "2022-07-21 07:21:05 [INFO ]  Epoch:    3 [      0/  50000 ( 0%)]\tLoss: 0.0368\t Data Time: 0.01s\tTrain Time: 0.58s\n",
            "2022-07-21 07:21:36 [INFO ]  Evaluation at Epoch 3\n",
            "2022-07-21 07:21:38 [INFO ]  Validation accuracy: 98.31\tmacro_fscore: 98.31\tmicro_fscore: 98.31\tTPR_GAP: 2.50\tFPR_GAP: 0.30\tPPR_GAP: 0.71\t\n",
            "2022-07-21 07:21:38 [INFO ]  Test accuracy: 98.45\tmacro_fscore: 98.44\tmicro_fscore: 98.45\tTPR_GAP: 2.05\tFPR_GAP: 0.23\tPPR_GAP: 0.86\t\n",
            "2022-07-21 07:21:39 [INFO ]  Epoch:    4 [      0/  50000 ( 0%)]\tLoss: 0.0100\t Data Time: 0.01s\tTrain Time: 0.57s\n",
            "2022-07-21 07:22:09 [INFO ]  Evaluation at Epoch 4\n",
            "2022-07-21 07:22:12 [INFO ]  Validation accuracy: 98.27\tmacro_fscore: 98.27\tmicro_fscore: 98.27\tTPR_GAP: 2.00\tFPR_GAP: 0.18\tPPR_GAP: 0.65\t\n",
            "2022-07-21 07:22:12 [INFO ]  Test accuracy: 98.44\tmacro_fscore: 98.43\tmicro_fscore: 98.44\tTPR_GAP: 1.79\tFPR_GAP: 0.20\tPPR_GAP: 0.81\t\n",
            "2022-07-21 07:22:12 [INFO ]  Epoch:    5 [      0/  50000 ( 0%)]\tLoss: 0.0130\t Data Time: 0.01s\tTrain Time: 0.61s\n",
            "2022-07-21 07:22:42 [INFO ]  Evaluation at Epoch 5\n",
            "2022-07-21 07:22:45 [INFO ]  Validation accuracy: 98.46\tmacro_fscore: 98.46\tmicro_fscore: 98.46\tTPR_GAP: 1.47\tFPR_GAP: 0.22\tPPR_GAP: 0.61\t\n",
            "2022-07-21 07:22:45 [INFO ]  Test accuracy: 98.52\tmacro_fscore: 98.51\tmicro_fscore: 98.52\tTPR_GAP: 1.47\tFPR_GAP: 0.16\tPPR_GAP: 0.83\t\n",
            "2022-07-21 07:22:45 [INFO ]  Epoch:    6 [      0/  50000 ( 0%)]\tLoss: 0.0104\t Data Time: 0.01s\tTrain Time: 0.56s\n",
            "2022-07-21 07:23:16 [INFO ]  Evaluation at Epoch 6\n",
            "2022-07-21 07:23:18 [INFO ]  Validation accuracy: 98.57\tmacro_fscore: 98.57\tmicro_fscore: 98.57\tTPR_GAP: 1.61\tFPR_GAP: 0.19\tPPR_GAP: 0.72\t\n",
            "2022-07-21 07:23:18 [INFO ]  Test accuracy: 98.74\tmacro_fscore: 98.73\tmicro_fscore: 98.74\tTPR_GAP: 1.45\tFPR_GAP: 0.15\tPPR_GAP: 0.80\t\n",
            "2022-07-21 07:23:19 [INFO ]  Epoch:    7 [      0/  50000 ( 0%)]\tLoss: 0.0070\t Data Time: 0.01s\tTrain Time: 0.60s\n",
            "2022-07-21 07:23:49 [INFO ]  Epochs since last improvement: 1\n",
            "2022-07-21 07:23:49 [INFO ]  Evaluation at Epoch 7\n",
            "2022-07-21 07:23:51 [INFO ]  Validation accuracy: 98.47\tmacro_fscore: 98.46\tmicro_fscore: 98.47\tTPR_GAP: 1.83\tFPR_GAP: 0.16\tPPR_GAP: 0.68\t\n",
            "2022-07-21 07:23:51 [INFO ]  Test accuracy: 98.55\tmacro_fscore: 98.53\tmicro_fscore: 98.55\tTPR_GAP: 1.66\tFPR_GAP: 0.16\tPPR_GAP: 0.77\t\n",
            "2022-07-21 07:23:52 [INFO ]  Epoch:    8 [      0/  50000 ( 0%)]\tLoss: 0.0069\t Data Time: 0.01s\tTrain Time: 0.57s\n",
            "2022-07-21 07:24:22 [INFO ]  Epochs since last improvement: 2\n",
            "2022-07-21 07:24:22 [INFO ]  Evaluation at Epoch 8\n",
            "2022-07-21 07:24:24 [INFO ]  Validation accuracy: 98.56\tmacro_fscore: 98.55\tmicro_fscore: 98.56\tTPR_GAP: 1.83\tFPR_GAP: 0.14\tPPR_GAP: 0.58\t\n",
            "2022-07-21 07:24:24 [INFO ]  Test accuracy: 98.65\tmacro_fscore: 98.64\tmicro_fscore: 98.65\tTPR_GAP: 1.80\tFPR_GAP: 0.18\tPPR_GAP: 0.82\t\n",
            "2022-07-21 07:24:25 [INFO ]  Epoch:    9 [      0/  50000 ( 0%)]\tLoss: 0.0015\t Data Time: 0.01s\tTrain Time: 0.57s\n",
            "2022-07-21 07:24:55 [INFO ]  Epochs since last improvement: 3\n",
            "2022-07-21 07:24:55 [INFO ]  Evaluation at Epoch 9\n",
            "2022-07-21 07:24:57 [INFO ]  Validation accuracy: 98.55\tmacro_fscore: 98.55\tmicro_fscore: 98.55\tTPR_GAP: 1.65\tFPR_GAP: 0.20\tPPR_GAP: 0.66\t\n",
            "2022-07-21 07:24:57 [INFO ]  Test accuracy: 98.67\tmacro_fscore: 98.66\tmicro_fscore: 98.67\tTPR_GAP: 1.58\tFPR_GAP: 0.17\tPPR_GAP: 0.82\t\n",
            "2022-07-21 07:24:58 [INFO ]  Epoch:   10 [      0/  50000 ( 0%)]\tLoss: 0.0157\t Data Time: 0.01s\tTrain Time: 0.56s\n",
            "2022-07-21 07:25:28 [INFO ]  Epochs since last improvement: 4\n",
            "2022-07-21 07:25:28 [INFO ]  Evaluation at Epoch 10\n",
            "2022-07-21 07:25:30 [INFO ]  Validation accuracy: 98.41\tmacro_fscore: 98.39\tmicro_fscore: 98.41\tTPR_GAP: 2.19\tFPR_GAP: 0.24\tPPR_GAP: 0.70\t\n",
            "2022-07-21 07:25:30 [INFO ]  Test accuracy: 98.55\tmacro_fscore: 98.53\tmicro_fscore: 98.55\tTPR_GAP: 1.47\tFPR_GAP: 0.18\tPPR_GAP: 0.82\t\n",
            "2022-07-21 07:25:31 [INFO ]  Epoch:   11 [      0/  50000 ( 0%)]\tLoss: 0.0038\t Data Time: 0.01s\tTrain Time: 0.56s\n",
            "2022-07-21 07:26:00 [INFO ]  Epochs since last improvement: 5\n",
            "2022-07-21 07:26:00 [INFO ]  Evaluation at Epoch 11\n",
            "2022-07-21 07:26:03 [INFO ]  Validation accuracy: 98.69\tmacro_fscore: 98.69\tmicro_fscore: 98.69\tTPR_GAP: 1.32\tFPR_GAP: 0.14\tPPR_GAP: 0.64\t\n",
            "2022-07-21 07:26:03 [INFO ]  Test accuracy: 98.84\tmacro_fscore: 98.83\tmicro_fscore: 98.84\tTPR_GAP: 1.21\tFPR_GAP: 0.13\tPPR_GAP: 0.87\t\n"
          ]
        }
      ],
      "source": [
        "model.train_self(\n",
        "    train_generator = customized_training_generator,\n",
        "    dev_generator = customized_validation_generator,\n",
        "    test_generator = customized_test_generator,\n",
        ")"
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Improveing Fairness"
      ],
      "metadata": {
        "id": "nD8YyTIZukpD"
      }
    },
    {
      "cell_type": "code",
      "execution_count": 18,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "xmqdlUG6UDT4",
        "outputId": "126c18c6-325b-45a8-bc1d-f6e6243f822a"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "2022-07-21 07:26:03 [INFO ]  Unexpected args: ['-f', '/root/.local/share/jupyter/runtime/kernel-a7e24054-f7e0-4930-9df2-bfcd40fedbad.json']\n",
            "2022-07-21 07:26:03 [INFO ]  Logging to ./results/dev/MNIST/BT_Adv/output.log\n",
            "2022-07-21 07:26:03 [INFO ]  ======================================== 2022-07-21 07:26:03 ========================================\n",
            "2022-07-21 07:26:03 [INFO ]  Base directory is ./results/dev/MNIST/BT_Adv\n",
            "2022-07-21 07:26:03 [INFO ]  Exception type : AssertionError \n",
            "2022-07-21 07:26:03 [INFO ]  Exception message : Not implemented\n",
            "2022-07-21 07:26:03 [INFO ]  Stack trace : ['File : /usr/local/lib/python3.7/dist-packages/fairlib/src/base_options.py , Line : 486, Func.Name : set_state, Message : train_iterator, dev_iterator, test_iterator = dataloaders.get_dataloaders(state)', 'File : /usr/local/lib/python3.7/dist-packages/fairlib/src/dataloaders/__init__.py , Line : 40, Func.Name : get_dataloaders, Message : ], \"Not implemented\"']\n",
            "2022-07-21 07:26:03 [INFO ]  dataloaders need to be initialized!\n",
            "2022-07-21 07:26:03 [INFO ]  SubDiscriminator( \n",
            "2022-07-21 07:26:03 [INFO ]    (grad_rev): GradientReversal()\n",
            "2022-07-21 07:26:03 [INFO ]    (output_layer): Linear(in_features=300, out_features=2, bias=True)\n",
            "2022-07-21 07:26:03 [INFO ]    (AF): ReLU()\n",
            "2022-07-21 07:26:03 [INFO ]    (hidden_layers): ModuleList(\n",
            "2022-07-21 07:26:03 [INFO ]      (0): Linear(in_features=300, out_features=300, bias=True)\n",
            "2022-07-21 07:26:03 [INFO ]      (1): ReLU()\n",
            "2022-07-21 07:26:03 [INFO ]      (2): Linear(in_features=300, out_features=300, bias=True)\n",
            "2022-07-21 07:26:03 [INFO ]      (3): ReLU()\n",
            "2022-07-21 07:26:03 [INFO ]    )\n",
            "2022-07-21 07:26:03 [INFO ]    (criterion): CrossEntropyLoss()\n",
            "2022-07-21 07:26:03 [INFO ]  )\n",
            "2022-07-21 07:26:03 [INFO ]  Total number of parameters: 181202 \n",
            "\n",
            "2022-07-21 07:26:03 [INFO ]  Discriminator built!\n",
            "Loaded data shapes: (49998,), (49998,), (49998,)\n",
            "Loaded data shapes: (10000,), (10000,), (10000,)\n",
            "Loaded data shapes: (10000,), (10000,), (10000,)\n",
            "2022-07-21 07:26:14 [INFO ]  MLP( \n",
            "2022-07-21 07:26:14 [INFO ]    (output_layer): Linear(in_features=300, out_features=10, bias=True)\n",
            "2022-07-21 07:26:14 [INFO ]    (AF): Tanh()\n",
            "2022-07-21 07:26:14 [INFO ]    (hidden_layers): ModuleList(\n",
            "2022-07-21 07:26:14 [INFO ]      (0): Linear(in_features=800, out_features=300, bias=True)\n",
            "2022-07-21 07:26:14 [INFO ]      (1): Tanh()\n",
            "2022-07-21 07:26:14 [INFO ]      (2): Linear(in_features=300, out_features=300, bias=True)\n",
            "2022-07-21 07:26:14 [INFO ]      (3): Tanh()\n",
            "2022-07-21 07:26:14 [INFO ]    )\n",
            "2022-07-21 07:26:14 [INFO ]    (criterion): CrossEntropyLoss()\n",
            "2022-07-21 07:26:14 [INFO ]  )\n",
            "2022-07-21 07:26:14 [INFO ]  Total number of parameters: 333610 \n",
            "\n",
            "2022-07-21 07:26:14 [INFO ]  ConvNet( \n",
            "2022-07-21 07:26:14 [INFO ]    (conv1): Conv2d(3, 20, kernel_size=(5, 5), stride=(1, 1))\n",
            "2022-07-21 07:26:14 [INFO ]    (conv2): Conv2d(20, 50, kernel_size=(5, 5), stride=(1, 1))\n",
            "2022-07-21 07:26:14 [INFO ]    (classifier): MLP(\n",
            "2022-07-21 07:26:14 [INFO ]      (output_layer): Linear(in_features=300, out_features=10, bias=True)\n",
            "2022-07-21 07:26:14 [INFO ]      (AF): Tanh()\n",
            "2022-07-21 07:26:14 [INFO ]      (hidden_layers): ModuleList(\n",
            "2022-07-21 07:26:14 [INFO ]        (0): Linear(in_features=800, out_features=300, bias=True)\n",
            "2022-07-21 07:26:14 [INFO ]        (1): Tanh()\n",
            "2022-07-21 07:26:14 [INFO ]        (2): Linear(in_features=300, out_features=300, bias=True)\n",
            "2022-07-21 07:26:14 [INFO ]        (3): Tanh()\n",
            "2022-07-21 07:26:14 [INFO ]      )\n",
            "2022-07-21 07:26:14 [INFO ]      (criterion): CrossEntropyLoss()\n",
            "2022-07-21 07:26:14 [INFO ]    )\n",
            "2022-07-21 07:26:14 [INFO ]    (criterion): CrossEntropyLoss()\n",
            "2022-07-21 07:26:14 [INFO ]  )\n",
            "2022-07-21 07:26:14 [INFO ]  Total number of parameters: 360180 \n",
            "\n"
          ]
        }
      ],
      "source": [
        "debiasing_args = {\n",
        "    \"dataset\":Shared_options[\"dataset\"], \n",
        "    \"data_dir\":Shared_options[\"data_dir\"],\n",
        "    \"device_id\":Shared_options[\"device_id\"],\n",
        "\n",
        "    # Give a name to the exp, which will be used in the path\n",
        "    \"exp_id\":\"BT_Adv\",\n",
        "\n",
        "    \"emb_size\": 4*4*50,\n",
        "    \"num_classes\": 10,\n",
        "    \"num_groups\": 2,\n",
        "\n",
        "    # Perform adversarial training if True\n",
        "    \"adv_debiasing\":True,\n",
        "\n",
        "    # Specify the hyperparameters for Balanced Training\n",
        "    \"BT\":\"Resampling\",\n",
        "    \"BTObj\":\"EO\",\n",
        "}\n",
        "\n",
        "# Init the argument\n",
        "debias_options = BaseOptions()\n",
        "debias_state = debias_options.get_state(args=debiasing_args, silence=True)\n",
        "\n",
        "customized_train_data = CustomizedDataset(args=debias_state, split=\"train\")\n",
        "customized_dev_data = CustomizedDataset(args=debias_state, split=\"dev\")\n",
        "customized_test_data = CustomizedDataset(args=debias_state, split=\"test\")\n",
        "\n",
        "# DataLoader Parameters\n",
        "tran_dataloader_params = {\n",
        "        'batch_size': state.batch_size,\n",
        "        'shuffle': True,\n",
        "        'num_workers': state.num_workers}\n",
        "\n",
        "eval_dataloader_params = {\n",
        "        'batch_size': state.test_batch_size,\n",
        "        'shuffle': False,\n",
        "        'num_workers': state.num_workers}\n",
        "\n",
        "# init dataloader\n",
        "customized_training_generator = torch.utils.data.DataLoader(customized_train_data, **tran_dataloader_params)\n",
        "customized_validation_generator = torch.utils.data.DataLoader(customized_dev_data, **eval_dataloader_params)\n",
        "customized_test_generator = torch.utils.data.DataLoader(customized_test_data, **eval_dataloader_params)\n",
        "\n",
        "debias_model = ConvNet(debias_state)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 19,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "jLJQQzilUDT4",
        "outputId": "5a6e988f-b59e-44af-9826-f336dec087ec"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "2022-07-21 07:26:16 [INFO ]  Epoch:    0 [      0/  49998 ( 0%)]\tLoss: 1.6374\t Data Time: 0.01s\tTrain Time: 1.56s\n",
            "2022-07-21 07:27:29 [INFO ]  Evaluation at Epoch 0\n",
            "2022-07-21 07:27:31 [INFO ]  Validation accuracy: 96.09\tmacro_fscore: 96.09\tmicro_fscore: 96.09\tTPR_GAP: 2.95\tFPR_GAP: 0.33\tPPR_GAP: 0.59\t\n",
            "2022-07-21 07:27:31 [INFO ]  Test accuracy: 97.04\tmacro_fscore: 97.02\tmicro_fscore: 97.04\tTPR_GAP: 2.98\tFPR_GAP: 0.20\tPPR_GAP: 1.09\t\n",
            "2022-07-21 07:27:33 [INFO ]  Epoch:    1 [      0/  49998 ( 0%)]\tLoss: -0.6122\t Data Time: 0.01s\tTrain Time: 1.44s\n",
            "2022-07-21 07:28:46 [INFO ]  Evaluation at Epoch 1\n",
            "2022-07-21 07:28:48 [INFO ]  Validation accuracy: 97.32\tmacro_fscore: 97.31\tmicro_fscore: 97.32\tTPR_GAP: 1.28\tFPR_GAP: 0.10\tPPR_GAP: 0.75\t\n",
            "2022-07-21 07:28:48 [INFO ]  Test accuracy: 97.99\tmacro_fscore: 97.97\tmicro_fscore: 97.99\tTPR_GAP: 0.97\tFPR_GAP: 0.10\tPPR_GAP: 0.97\t\n",
            "2022-07-21 07:28:50 [INFO ]  Epoch:    2 [      0/  49998 ( 0%)]\tLoss: -0.6411\t Data Time: 0.01s\tTrain Time: 1.48s\n",
            "2022-07-21 07:30:02 [INFO ]  Evaluation at Epoch 2\n",
            "2022-07-21 07:30:05 [INFO ]  Validation accuracy: 97.92\tmacro_fscore: 97.91\tmicro_fscore: 97.92\tTPR_GAP: 1.31\tFPR_GAP: 0.12\tPPR_GAP: 0.80\t\n",
            "2022-07-21 07:30:05 [INFO ]  Test accuracy: 98.38\tmacro_fscore: 98.37\tmicro_fscore: 98.38\tTPR_GAP: 0.96\tFPR_GAP: 0.09\tPPR_GAP: 1.00\t\n",
            "2022-07-21 07:30:07 [INFO ]  Epoch:    3 [      0/  49998 ( 0%)]\tLoss: -0.6523\t Data Time: 0.01s\tTrain Time: 1.76s\n",
            "2022-07-21 07:31:20 [INFO ]  Evaluation at Epoch 3\n",
            "2022-07-21 07:31:23 [INFO ]  Validation accuracy: 98.17\tmacro_fscore: 98.17\tmicro_fscore: 98.17\tTPR_GAP: 0.94\tFPR_GAP: 0.10\tPPR_GAP: 0.67\t\n",
            "2022-07-21 07:31:23 [INFO ]  Test accuracy: 98.52\tmacro_fscore: 98.51\tmicro_fscore: 98.52\tTPR_GAP: 1.25\tFPR_GAP: 0.09\tPPR_GAP: 1.00\t\n",
            "2022-07-21 07:31:25 [INFO ]  Epoch:    4 [      0/  49998 ( 0%)]\tLoss: -0.6713\t Data Time: 0.01s\tTrain Time: 1.46s\n",
            "2022-07-21 07:32:38 [INFO ]  Evaluation at Epoch 4\n",
            "2022-07-21 07:32:41 [INFO ]  Validation accuracy: 98.57\tmacro_fscore: 98.56\tmicro_fscore: 98.57\tTPR_GAP: 0.74\tFPR_GAP: 0.09\tPPR_GAP: 0.75\t\n",
            "2022-07-21 07:32:41 [INFO ]  Test accuracy: 98.78\tmacro_fscore: 98.77\tmicro_fscore: 98.78\tTPR_GAP: 0.46\tFPR_GAP: 0.08\tPPR_GAP: 0.93\t\n",
            "2022-07-21 07:32:42 [INFO ]  Epoch:    5 [      0/  49998 ( 0%)]\tLoss: -0.6775\t Data Time: 0.01s\tTrain Time: 1.45s\n",
            "2022-07-21 07:33:58 [INFO ]  Epochs since last improvement: 1\n",
            "2022-07-21 07:33:58 [INFO ]  Evaluation at Epoch 5\n",
            "2022-07-21 07:34:01 [INFO ]  Validation accuracy: 98.54\tmacro_fscore: 98.53\tmicro_fscore: 98.54\tTPR_GAP: 0.78\tFPR_GAP: 0.06\tPPR_GAP: 0.73\t\n",
            "2022-07-21 07:34:01 [INFO ]  Test accuracy: 98.76\tmacro_fscore: 98.76\tmicro_fscore: 98.76\tTPR_GAP: 0.74\tFPR_GAP: 0.09\tPPR_GAP: 0.88\t\n",
            "2022-07-21 07:34:02 [INFO ]  Epoch:    6 [      0/  49998 ( 0%)]\tLoss: -0.6868\t Data Time: 0.01s\tTrain Time: 1.49s\n",
            "2022-07-21 07:35:16 [INFO ]  Epochs since last improvement: 2\n",
            "2022-07-21 07:35:16 [INFO ]  Evaluation at Epoch 6\n",
            "2022-07-21 07:35:18 [INFO ]  Validation accuracy: 98.60\tmacro_fscore: 98.59\tmicro_fscore: 98.60\tTPR_GAP: 0.54\tFPR_GAP: 0.06\tPPR_GAP: 0.73\t\n",
            "2022-07-21 07:35:18 [INFO ]  Test accuracy: 98.74\tmacro_fscore: 98.73\tmicro_fscore: 98.74\tTPR_GAP: 0.80\tFPR_GAP: 0.07\tPPR_GAP: 0.97\t\n",
            "2022-07-21 07:35:20 [INFO ]  Epoch:    7 [      0/  49998 ( 0%)]\tLoss: -0.6850\t Data Time: 0.01s\tTrain Time: 1.48s\n",
            "2022-07-21 07:36:32 [INFO ]  Evaluation at Epoch 7\n",
            "2022-07-21 07:36:35 [INFO ]  Validation accuracy: 98.65\tmacro_fscore: 98.64\tmicro_fscore: 98.65\tTPR_GAP: 0.64\tFPR_GAP: 0.08\tPPR_GAP: 0.75\t\n",
            "2022-07-21 07:36:35 [INFO ]  Test accuracy: 98.82\tmacro_fscore: 98.81\tmicro_fscore: 98.82\tTPR_GAP: 0.39\tFPR_GAP: 0.06\tPPR_GAP: 0.95\t\n",
            "2022-07-21 07:36:36 [INFO ]  Epoch:    8 [      0/  49998 ( 0%)]\tLoss: -0.6916\t Data Time: 0.01s\tTrain Time: 1.47s\n",
            "2022-07-21 07:37:49 [INFO ]  Epochs since last improvement: 1\n",
            "2022-07-21 07:37:49 [INFO ]  Evaluation at Epoch 8\n",
            "2022-07-21 07:37:52 [INFO ]  Validation accuracy: 98.56\tmacro_fscore: 98.55\tmicro_fscore: 98.56\tTPR_GAP: 0.66\tFPR_GAP: 0.08\tPPR_GAP: 0.76\t\n",
            "2022-07-21 07:37:52 [INFO ]  Test accuracy: 98.79\tmacro_fscore: 98.78\tmicro_fscore: 98.79\tTPR_GAP: 1.01\tFPR_GAP: 0.08\tPPR_GAP: 0.96\t\n",
            "2022-07-21 07:37:53 [INFO ]  Epoch:    9 [      0/  49998 ( 0%)]\tLoss: -0.6902\t Data Time: 0.01s\tTrain Time: 1.46s\n",
            "2022-07-21 07:39:05 [INFO ]  Epochs since last improvement: 2\n",
            "2022-07-21 07:39:05 [INFO ]  Evaluation at Epoch 9\n",
            "2022-07-21 07:39:08 [INFO ]  Validation accuracy: 98.38\tmacro_fscore: 98.37\tmicro_fscore: 98.38\tTPR_GAP: 0.74\tFPR_GAP: 0.11\tPPR_GAP: 0.70\t\n",
            "2022-07-21 07:39:08 [INFO ]  Test accuracy: 98.72\tmacro_fscore: 98.71\tmicro_fscore: 98.72\tTPR_GAP: 0.68\tFPR_GAP: 0.07\tPPR_GAP: 0.94\t\n",
            "2022-07-21 07:39:09 [INFO ]  Epoch:   10 [      0/  49998 ( 0%)]\tLoss: -0.6885\t Data Time: 0.01s\tTrain Time: 1.44s\n",
            "2022-07-21 07:40:22 [INFO ]  Epochs since last improvement: 3\n",
            "2022-07-21 07:40:22 [INFO ]  Evaluation at Epoch 10\n",
            "2022-07-21 07:40:24 [INFO ]  Validation accuracy: 98.33\tmacro_fscore: 98.32\tmicro_fscore: 98.33\tTPR_GAP: 0.89\tFPR_GAP: 0.08\tPPR_GAP: 0.66\t\n",
            "2022-07-21 07:40:24 [INFO ]  Test accuracy: 98.71\tmacro_fscore: 98.70\tmicro_fscore: 98.71\tTPR_GAP: 0.89\tFPR_GAP: 0.08\tPPR_GAP: 0.96\t\n",
            "2022-07-21 07:40:26 [INFO ]  Epoch:   11 [      0/  49998 ( 0%)]\tLoss: -0.6860\t Data Time: 0.01s\tTrain Time: 1.46s\n",
            "2022-07-21 07:41:39 [INFO ]  Epochs since last improvement: 4\n",
            "2022-07-21 07:41:39 [INFO ]  Evaluation at Epoch 11\n",
            "2022-07-21 07:41:41 [INFO ]  Validation accuracy: 98.67\tmacro_fscore: 98.66\tmicro_fscore: 98.67\tTPR_GAP: 0.81\tFPR_GAP: 0.11\tPPR_GAP: 0.74\t\n",
            "2022-07-21 07:41:41 [INFO ]  Test accuracy: 98.83\tmacro_fscore: 98.82\tmicro_fscore: 98.83\tTPR_GAP: 0.92\tFPR_GAP: 0.10\tPPR_GAP: 0.90\t\n",
            "2022-07-21 07:41:43 [INFO ]  Epoch:   12 [      0/  49998 ( 0%)]\tLoss: -0.6909\t Data Time: 0.01s\tTrain Time: 1.46s\n",
            "2022-07-21 07:42:54 [INFO ]  Epochs since last improvement: 5\n",
            "2022-07-21 07:42:54 [INFO ]  Evaluation at Epoch 12\n",
            "2022-07-21 07:42:57 [INFO ]  Validation accuracy: 98.61\tmacro_fscore: 98.60\tmicro_fscore: 98.61\tTPR_GAP: 0.74\tFPR_GAP: 0.09\tPPR_GAP: 0.73\t\n",
            "2022-07-21 07:42:57 [INFO ]  Test accuracy: 98.90\tmacro_fscore: 98.89\tmicro_fscore: 98.90\tTPR_GAP: 0.64\tFPR_GAP: 0.06\tPPR_GAP: 0.96\t\n"
          ]
        }
      ],
      "source": [
        "debias_model.train_self(\n",
        "    train_generator = customized_training_generator,\n",
        "    dev_generator = customized_validation_generator,\n",
        "    test_generator = customized_test_generator,\n",
        ")"
      ]
    }
  ],
  "metadata": {
    "colab": {
      "collapsed_sections": [],
      "name": "Image_Inputs.ipynb",
      "provenance": [],
      "toc_visible": true
    },
    "interpreter": {
      "hash": "086b6e2ac5931a4f7a51b812f0475290a145e7d51f3e22b53c52adf5c273fe30"
    },
    "kernelspec": {
      "display_name": "Python 3.7.12 ('py37')",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.7.12"
    },
    "orig_nbformat": 4,
    "widgets": {
      "application/vnd.jupyter.widget-state+json": {
        "f476f1ef666d451d845aae44e2cd0735": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_350013664d2547dab32f22c3daf5ea86",
              "IPY_MODEL_c39600fb97154bba9520460cb2790f73",
              "IPY_MODEL_638a20255163424099d89e0bdf1ea4f6"
            ],
            "layout": "IPY_MODEL_d4a1ff4e49b64c10a3fddbac8d1fb8da"
          }
        },
        "350013664d2547dab32f22c3daf5ea86": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_b8191bed08814b7182700dc3265b9630",
            "placeholder": "​",
            "style": "IPY_MODEL_80c25effb753416ea40429f6aa9d495f",
            "value": "100%"
          }
        },
        "c39600fb97154bba9520460cb2790f73": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_8cd753be9f5141d7bff11788eba930a7",
            "max": 9912422,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_b393370e359344c59b7bd333c30749ad",
            "value": 9912422
          }
        },
        "638a20255163424099d89e0bdf1ea4f6": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_0da7f60955a644e9b84b89065fc5bd7e",
            "placeholder": "​",
            "style": "IPY_MODEL_6e7232d9fec541a4b21d13208a9f3dbf",
            "value": " 9912422/9912422 [00:00&lt;00:00, 64526099.15it/s]"
          }
        },
        "d4a1ff4e49b64c10a3fddbac8d1fb8da": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "b8191bed08814b7182700dc3265b9630": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "80c25effb753416ea40429f6aa9d495f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "8cd753be9f5141d7bff11788eba930a7": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "b393370e359344c59b7bd333c30749ad": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "0da7f60955a644e9b84b89065fc5bd7e": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "6e7232d9fec541a4b21d13208a9f3dbf": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "cf77d1cf4ab5417eb45ebb8cbbf0b238": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_a9f10e46cf5e44eb8c446dc92912dea9",
              "IPY_MODEL_81631b8da4bd4e50bdf0e297b56df82e",
              "IPY_MODEL_25ac5d7180ef4549b99d4078529ee67c"
            ],
            "layout": "IPY_MODEL_a0c0d164adc54af0bb2ce4d54787e7f6"
          }
        },
        "a9f10e46cf5e44eb8c446dc92912dea9": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_69baf1d249704c5cabd181f7333cf7f9",
            "placeholder": "​",
            "style": "IPY_MODEL_ce5d67d6be5243ccbd3a1382fbcf30ec",
            "value": "100%"
          }
        },
        "81631b8da4bd4e50bdf0e297b56df82e": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_24f96010cab4484faa46aa70ed3d23bb",
            "max": 28881,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_e92ac01372cb4a4b8dbb7a7db7991073",
            "value": 28881
          }
        },
        "25ac5d7180ef4549b99d4078529ee67c": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_b4ad8d187b094ffd8aefcef1680d4ffb",
            "placeholder": "​",
            "style": "IPY_MODEL_7b6298fe6b2f4307906ae5021caa4d4b",
            "value": " 28881/28881 [00:00&lt;00:00, 591861.46it/s]"
          }
        },
        "a0c0d164adc54af0bb2ce4d54787e7f6": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "69baf1d249704c5cabd181f7333cf7f9": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "ce5d67d6be5243ccbd3a1382fbcf30ec": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "24f96010cab4484faa46aa70ed3d23bb": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "e92ac01372cb4a4b8dbb7a7db7991073": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "b4ad8d187b094ffd8aefcef1680d4ffb": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "7b6298fe6b2f4307906ae5021caa4d4b": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "7cb8b35ea5f8401fa9e5c52546d2324e": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_a426c8a9ad3b46589d9fce4f3b60a73b",
              "IPY_MODEL_94ad67e14d53417a91983e1c197993a5",
              "IPY_MODEL_83490315ba8c49c8a860f4ea6acd7956"
            ],
            "layout": "IPY_MODEL_dec18cf4bb694ac987fa8689c64d2ac6"
          }
        },
        "a426c8a9ad3b46589d9fce4f3b60a73b": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_42e5290426df4608a7216a392760310c",
            "placeholder": "​",
            "style": "IPY_MODEL_0b58cdde644e4bff889adb2332c644ce",
            "value": "100%"
          }
        },
        "94ad67e14d53417a91983e1c197993a5": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_d7fc7b1718e4456cabb199a03e5d79d9",
            "max": 1648877,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_3ba0ea02505846dda98c9dd19bcab8c5",
            "value": 1648877
          }
        },
        "83490315ba8c49c8a860f4ea6acd7956": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_973ebcf9fc4043b48baf2daff6b47cbe",
            "placeholder": "​",
            "style": "IPY_MODEL_560480b544b049919e62816d119fb66b",
            "value": " 1648877/1648877 [00:00&lt;00:00, 28211546.67it/s]"
          }
        },
        "dec18cf4bb694ac987fa8689c64d2ac6": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "42e5290426df4608a7216a392760310c": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "0b58cdde644e4bff889adb2332c644ce": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "d7fc7b1718e4456cabb199a03e5d79d9": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "3ba0ea02505846dda98c9dd19bcab8c5": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "973ebcf9fc4043b48baf2daff6b47cbe": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "560480b544b049919e62816d119fb66b": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "3c012ef53bc74d048a15291265af0ce0": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_18cdf54a8b5642fba326d0ce4e35dfb7",
              "IPY_MODEL_7af12cf5083745c695caaa94fc9eada6",
              "IPY_MODEL_6a1cd3efa5b64bbeb43b2fdec01ee400"
            ],
            "layout": "IPY_MODEL_e95bdfb506ba42249adae72fee60ea72"
          }
        },
        "18cdf54a8b5642fba326d0ce4e35dfb7": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_71d4d1d4e32542d8beffc7bb8d5354fd",
            "placeholder": "​",
            "style": "IPY_MODEL_ce5c98c15b9e4b0f92e622589da4189d",
            "value": "100%"
          }
        },
        "7af12cf5083745c695caaa94fc9eada6": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_946690ebb4994fb496af345ddb02c8f3",
            "max": 4542,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_941032cafeb849108a0615dd825a05fd",
            "value": 4542
          }
        },
        "6a1cd3efa5b64bbeb43b2fdec01ee400": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_99b2c841b8b34e669e50d7d715fb55d5",
            "placeholder": "​",
            "style": "IPY_MODEL_3a5754597a944854a69718b6a21c4a6a",
            "value": " 4542/4542 [00:00&lt;00:00, 107906.27it/s]"
          }
        },
        "e95bdfb506ba42249adae72fee60ea72": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "71d4d1d4e32542d8beffc7bb8d5354fd": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "ce5c98c15b9e4b0f92e622589da4189d": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "946690ebb4994fb496af345ddb02c8f3": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "941032cafeb849108a0615dd825a05fd": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "99b2c841b8b34e669e50d7d715fb55d5": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "3a5754597a944854a69718b6a21c4a6a": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "98dffc6c6e784decb165b104dda25eea": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_b2f715e769dd41d887d8b68b25eba686",
              "IPY_MODEL_b0133d2f7ae945bdba6bd2f285da251a",
              "IPY_MODEL_d11573a5f6054a14b7d24f256c6c5664"
            ],
            "layout": "IPY_MODEL_26849eb841d44d9285b58698217bd7a6"
          }
        },
        "b2f715e769dd41d887d8b68b25eba686": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_9dee0fbb50f645cf865e58fdadb52160",
            "placeholder": "​",
            "style": "IPY_MODEL_f4f2d9993a0d456fb75b4c2148a45e8f",
            "value": "100%"
          }
        },
        "b0133d2f7ae945bdba6bd2f285da251a": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_cae8fe4d51d64e0a8638d008a16f12cf",
            "max": 9912422,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_2f2bb2e08d194286bb25185161cc16a0",
            "value": 9912422
          }
        },
        "d11573a5f6054a14b7d24f256c6c5664": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_0d1adfd350fb47e7bc42d195febb7403",
            "placeholder": "​",
            "style": "IPY_MODEL_0a56f053c7ed4a2fbc010141280ee559",
            "value": " 9912422/9912422 [00:00&lt;00:00, 16785150.67it/s]"
          }
        },
        "26849eb841d44d9285b58698217bd7a6": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "9dee0fbb50f645cf865e58fdadb52160": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "f4f2d9993a0d456fb75b4c2148a45e8f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "cae8fe4d51d64e0a8638d008a16f12cf": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "2f2bb2e08d194286bb25185161cc16a0": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "0d1adfd350fb47e7bc42d195febb7403": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "0a56f053c7ed4a2fbc010141280ee559": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "e14c40fc216f4d23925a23875189d5c6": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_17b37119ce2b4dc882e684b7e73b1b30",
              "IPY_MODEL_d5958c8ebd854a2fab9b3de2df64fc4a",
              "IPY_MODEL_a3900a446db446c6af54bab34c9c146a"
            ],
            "layout": "IPY_MODEL_2a180bb795eb4667b0fcb2d61c2a7b0f"
          }
        },
        "17b37119ce2b4dc882e684b7e73b1b30": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_fb8a816f36004a3fae9fa29ea7746744",
            "placeholder": "​",
            "style": "IPY_MODEL_22ffe204bb144301a8a6d76f7498c4d9",
            "value": "100%"
          }
        },
        "d5958c8ebd854a2fab9b3de2df64fc4a": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_4977d2c141f74ce5a49d23d6d33d4f52",
            "max": 28881,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_9158bd9daf4c4790b1a8ec8408e0315d",
            "value": 28881
          }
        },
        "a3900a446db446c6af54bab34c9c146a": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_244472db2ef04366a1310e3319c178b6",
            "placeholder": "​",
            "style": "IPY_MODEL_7c1128aa2d8c4bdeae004552c49f74fb",
            "value": " 28881/28881 [00:00&lt;00:00, 282243.24it/s]"
          }
        },
        "2a180bb795eb4667b0fcb2d61c2a7b0f": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "fb8a816f36004a3fae9fa29ea7746744": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "22ffe204bb144301a8a6d76f7498c4d9": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "4977d2c141f74ce5a49d23d6d33d4f52": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "9158bd9daf4c4790b1a8ec8408e0315d": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "244472db2ef04366a1310e3319c178b6": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "7c1128aa2d8c4bdeae004552c49f74fb": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "ee47162c16d9412e96dcf712deef60d0": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_abedf6d04500432e8de53ee13e5bbc04",
              "IPY_MODEL_a5a522a3871e4ce8830ab491a56abb82",
              "IPY_MODEL_e1c70c718b4544f3bdef10c25adf3269"
            ],
            "layout": "IPY_MODEL_7f0725431328403ab983b669fb2bb8bb"
          }
        },
        "abedf6d04500432e8de53ee13e5bbc04": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_b81473d83001464eabd4488d0e531c46",
            "placeholder": "​",
            "style": "IPY_MODEL_84844064e27b4a97bc1b51a568dc8b19",
            "value": "100%"
          }
        },
        "a5a522a3871e4ce8830ab491a56abb82": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_cb2d7c0e25e2448a9e798b7e18e18c5b",
            "max": 1648877,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_a3bbb9658a474726bfb39957c60b8492",
            "value": 1648877
          }
        },
        "e1c70c718b4544f3bdef10c25adf3269": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_a4456d82cca6453a8923fb0a9ba50655",
            "placeholder": "​",
            "style": "IPY_MODEL_01b651eb04b14703a857dca81c267a76",
            "value": " 1648877/1648877 [00:00&lt;00:00, 13109186.89it/s]"
          }
        },
        "7f0725431328403ab983b669fb2bb8bb": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "b81473d83001464eabd4488d0e531c46": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "84844064e27b4a97bc1b51a568dc8b19": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "cb2d7c0e25e2448a9e798b7e18e18c5b": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "a3bbb9658a474726bfb39957c60b8492": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "a4456d82cca6453a8923fb0a9ba50655": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "01b651eb04b14703a857dca81c267a76": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "b01c8ad2f24c40f49bcfd29b55e62037": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_ba938b75f05345f5ab996e6a91a3f154",
              "IPY_MODEL_1bd04f11f0484ae2b80aa5486e21422d",
              "IPY_MODEL_d608838383cc4771918f4e0f26636001"
            ],
            "layout": "IPY_MODEL_99f31a083199483fa767c28b5f8303ae"
          }
        },
        "ba938b75f05345f5ab996e6a91a3f154": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_f98eeccb241e479a97f56345686a1c2d",
            "placeholder": "​",
            "style": "IPY_MODEL_accd6192f90f4a52ab5e90b4b98e1d7d",
            "value": "100%"
          }
        },
        "1bd04f11f0484ae2b80aa5486e21422d": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_80a488d4c84a4a99b804f6a868919418",
            "max": 4542,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_e3c9eff582a4489594792f0757b84a5b",
            "value": 4542
          }
        },
        "d608838383cc4771918f4e0f26636001": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_0ee298418327491ba7d8f5fe5a73edb6",
            "placeholder": "​",
            "style": "IPY_MODEL_62f4378e324c44b79a8e4a9107537e25",
            "value": " 4542/4542 [00:00&lt;00:00, 60568.63it/s]"
          }
        },
        "99f31a083199483fa767c28b5f8303ae": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "f98eeccb241e479a97f56345686a1c2d": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "accd6192f90f4a52ab5e90b4b98e1d7d": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "80a488d4c84a4a99b804f6a868919418": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "e3c9eff582a4489594792f0757b84a5b": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "0ee298418327491ba7d8f5fe5a73edb6": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "62f4378e324c44b79a8e4a9107537e25": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        }
      }
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}